package com.evil.application.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evil.application.pojo.bo.application.robot.rule.ApplicationRobotRuleBO;
import com.evil.application.pojo.entity.ApplicationRobotRule;
import com.evil.common.application.dto.robot.RobotRuleDTO;
import com.evil.common.application.dto.robot.rule.CopyRobotRuleReqDTO;
import com.evil.common.application.dto.robot.rule.RobotRuleSourceDTO;
import com.evil.common.application.dto.robot.rule.RobotRulesDTO;
import com.evil.common.application.enums.robot.RobotRuleSourceTypeEnum;
import org.springframework.validation.annotation.Validated;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 机器人规则表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
public interface ApplicationRobotRuleService extends IService<ApplicationRobotRule> {

    /**
     * 获取机器人规则
     *
     * @param sourceDTO sourceDTO
     * @return List
     */
    List<RobotRuleDTO> findBySource(RobotRuleSourceDTO sourceDTO);

    /**
     * 获取机器人规则
     *
     * @param sourceTypeEnum sourceTypeEnum
     * @param sourceIds      sourceIds
     * @return Map
     */
    Map<Long, List<RobotRuleDTO>> findMapBySourceIds(RobotRuleSourceTypeEnum sourceTypeEnum, Collection<Long> sourceIds);

    /**
     * 获取机器人规则
     *
     * @param sourceDTO sourceDTO
     * @return List
     */
    List<ApplicationRobotRuleBO> findBOBySource(RobotRuleSourceDTO sourceDTO);

    /**
     * 保存机器人规则
     *
     * @param robotRulesDTO robotRuleSourceDTO
     */
    void saveRobotRule(@Validated RobotRulesDTO robotRulesDTO);

    /**
     * 复制机器人规则
     *
     * @param copyRobotRuleReqDTO copyRobotRuleDTO
     */
    void copyRobotRule(CopyRobotRuleReqDTO copyRobotRuleReqDTO);
}
